<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改用户管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-subscribe-edit" th:object="${subscribe}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">账号：</label>
                <div class="col-sm-8">
                    <input name="subscriber" th:field="*{subscriber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">密码：</label>
                <div class="col-sm-8">
                    <input name="password" th:value="*{password}" class="form-control" type="password" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-8">
                    <input name="realname" th:field="*{realname}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('radius_subscriber_status')}">
                        <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">到期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="expireTime" th:value="${#dates.format(subscribe.expireTime, 'yyyy-MM-dd hh:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">最大在线：</label>
                <div class="col-sm-8">
                    <input name="activeNum" th:field="*{activeNum}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">上行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="upRate" th:field="*{upRate}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">下行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="downRate" th:field="*{downRate}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">突发上行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="upPeakRate" th:field="*{upPeakRate}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">突发下行速率(Mbps)：</label>
                <div class="col-sm-8">
                    <input name="downPeakRate" th:field="*{downPeakRate}" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">绑定MAC：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('radius_bind_mac')}">
                        <input type="radio" th:id="${dict.dictCode}" name="bindMac" th:value="${dict.dictValue}" th:field="*{bindMac}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">绑定VLAN：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('radius_bind_vlan')}">
                        <input type="radio" th:id="${dict.dictCode}" name="bindVlan" th:value="${dict.dictValue}" th:field="*{bindVlan}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">地址池：</label>
                <div class="col-sm-8">
                    <input name="addrPool" th:field="*{addrPool}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">固定IP地址：</label>
                <div class="col-sm-8">
                    <input name="ipAddr" th:field="*{ipAddr}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">MAc地址：</label>
                <div class="col-sm-8">
                    <input name="macAddr" th:field="*{macAddr}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">内层VLAN：</label>
                <div class="col-sm-8">
                    <input name="inVlan" th:field="*{inVlan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">外层VLAN：</label>
                <div class="col-sm-8">
                    <input name="outVlan" th:field="*{outVlan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">认证域：</label>
                <div class="col-sm-8">
                    <input name="domain" th:field="*{domain}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上行速率策略：</label>
                <div class="col-sm-8">
                    <input name="upRateCode" th:field="*{upRateCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">下行速率策略：</label>
                <div class="col-sm-8">
                    <input name="downRateCode" th:field="*{downRateCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">自定义策略：</label>
                <div class="col-sm-8">
                    <textarea name="policy" class="form-control">[[*{policy}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "radius/subscribe";
        $("#form-subscribe-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-subscribe-edit').serialize());
            }
        }

        $("input[name='expireTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            autoclose: true,
            minView: 0,
            minuteStep:1
        });
    </script>
</body>
</html>